import React, { Component } from 'react';
import { observer, inject } from 'mobx-react';
import { MapPage } from 'weaver-mobile-page';
import { withRouter } from 'react-router-dom';
import ChangePositionStore from '../../../stores/card/changePoisitionStore';
// const Edit = MapPage.Edit;

@withRouter
@observer
export default class ChangePoisition extends Component {
    constructor(props) {
        super(props);
        this.state = {
            store: new ChangePositionStore(),
        }
    }
    componentWillMount() {
        // console.log(this.props)
        const store = this.state.store;
        store.doInit(this);
    }
    render() {
        const { mapPage } = this.state.store;
        const { lat1, lng1, onSubmit } = this.props;
        return (
            <MapPage
                store={mapPage}
                ableToChangeLocation={true}
                position={[Number(lng1), Number(lat1)]}
                onSubmit={onSubmit}
            />
        );
    }
}
